package com.controller;

import ch.qos.logback.core.net.SyslogOutputStream;
import com.product.FanoutProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProducerController {
    @Autowired
    private FanoutProducer fanoutProducer;

    @RequestMapping("/sendFanout")
    public String sendFanout(String queueName) {
        System.out.println(" 要发送的队列名称：" + queueName);
        fanoutProducer.send(queueName);
        return "success";
    }
}
